package com.medsoft.drpcp;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

import com.medsoft.drpcp.meta.DrpcpHead;

public class ServiceDefinition /*extends DrpcpHead*/ {
	private String serviceId;
	private boolean isExport;
	public boolean isExport() {
		return isExport;
	}
	public void setExport(boolean isExport) {
		this.isExport = isExport;
	}
	private String desc;
	private int timeout = 0;
	private Class clz;
	private Method method;
	private Class retType;
	public String getSystemId() {
		return systemId;
	}
	public ServiceDefinition setSystemId(String systemId) {
		this.systemId = systemId;
		return this;
	}
	public String getSubSystemId() {
		return subSystemId;
	}
	public ServiceDefinition setSubSystemId(String subSystemId) {
		this.subSystemId = subSystemId;
		return this;
	}
	private Class<?>[] paramType;
	private String nodeName;
	private String systemId;
	private String subSystemId;
	public String getServiceId() {
		return serviceId;
	}
	public ServiceDefinition setServiceId(String serviceId) {
		this.serviceId = serviceId;
		return this;
	}
	public String getDesc() {
		return desc;
	}
	public ServiceDefinition setDesc(String desc) {
		this.desc = desc;
		return this;
	}
	public int getTimeout() {
		return timeout;
	}
	public ServiceDefinition setTimeout(int timeout) {
		this.timeout = timeout;
		return this;
	}
	public String getNodeName() {
		return nodeName;
	}
	public ServiceDefinition setNodeName(String nodeName) {
		this.nodeName = nodeName;
		return this;
	}
	public Class getClz() {
		return clz;
	}
	public ServiceDefinition setClz(Class clz) {
		this.clz = clz;
		return this;
	}
	public Method getMethod() {
		return method;
	}
	public ServiceDefinition setMethod(Method method) {
		this.method = method;
		return this;
	}
	public Class getRetType() {
		return retType;
	}
	public ServiceDefinition setRetType(Class retType) {
		this.retType = retType;
		return this;
	}
	public Class getParamType() {
		return paramType[0];
	}
	public ServiceDefinition setParamType(Class<?>[] paramType) {
		this.paramType = paramType;
		return this;
	}
	@Override
	public String toString() {
		return "ServiceDefinition [serviceId=" + serviceId + ", desc=" + desc + ", timeout=" + timeout
				+ ", 服务接口=" + clz.getCanonicalName() + ", 服务方法=" + method.getName() + ", 返回类型="
				+ retType.getCanonicalName() + ", 参数类型=" + paramType[0].getCanonicalName() + ", 路由目标节点="
				+ nodeName + "]";
	}
}
